//
//  NewPaySuccessVc.m
//  Shengzhuli
//
//  Created by FXGuo on 2018/1/28.
//  Copyright © 2018年 kamangkeji. All rights reserved.
//

#import "NewPaySuccessVc.h"
#import "UIColor+Extension.h"

@interface NewPaySuccessVc ()
@property (weak, nonatomic) IBOutlet UIView *coverView;
@property (weak, nonatomic) IBOutlet UILabel *titLab;
@property (weak, nonatomic) IBOutlet UILabel *subTitLab;

@end

@implementation NewPaySuccessVc

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController setNavigationBarHidden:YES animated:NO];
    if (self.isFromBase&&self.isZero) {
        self.titLab.text = @"报名成功";
        self.subTitLab.text = @"请到“我的-已报名活动”中查看";
    }else if (self.isFromBase&&!self.isZero){
        self.titLab.text = @"支付成功";
        self.subTitLab.text = @"请到“我的-已报名活动”中查看";
    }
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.coverView.layer addSublayer:[UIColor setGradualChangingColor:self.view.bounds fromColor:RGBColor(234, 111, 90) toColor:[UIColor whiteColor]]];
    });
}
- (IBAction)backClick:(UIButton *)btn
{
    [self backClick];
}

//重写返回按钮方法
- (UIBarButtonItem *)customBackItemWithTarget:(id)target action:(SEL)action
{
    UIButton *backBtn = [[UIButton alloc]init];
    backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    [backBtn setBackgroundImage:[UIImage imageNamed:@"back_black"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    [backBtn sizeToFit];
    backBtn.contentEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
    return [[UIBarButtonItem alloc]initWithCustomView:backBtn];
}
- (void)backClick
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}


@end
